<html>
<head><meta charset="utf-8"><title>impl_trait_let_binding error detection in typeck · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html">impl_trait_let_binding error detection in typeck</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246146941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246146941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246146941">(Jul 15 2021 at 19:55)</a>:</h4>
<p>do someone know why this <a href="https://github.com/rust-lang/rust/blob/26366828a40403c83d6cc29bf5614a6e0388354c/compiler/rustc_typeck/src/check/gather_locals.rs#L64">https://github.com/rust-lang/rust/blob/26366828a40403c83d6cc29bf5614a6e0388354c/compiler/rustc_typeck/src/check/gather_locals.rs#L64</a> is checked using the feature flag there?</p>



<a name="246146946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246146946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246146946">(Jul 15 2021 at 19:55)</a>:</h4>
<p>and same for</p>



<a name="246147093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246147093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246147093">(Jul 15 2021 at 19:56)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/26366828a40403c83d6cc29bf5614a6e0388354c/compiler/rustc_typeck/src/check/mod.rs#L563">https://github.com/rust-lang/rust/blob/26366828a40403c83d6cc29bf5614a6e0388354c/compiler/rustc_typeck/src/check/mod.rs#L563</a></p>



<a name="246147221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246147221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246147221">(Jul 15 2021 at 19:57)</a>:</h4>
<p>I meant, I want to remove the feature flag and can't check that in that way anymore</p>



<a name="246147317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246147317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246147317">(Jul 15 2021 at 19:58)</a>:</h4>
<p>I could pass some other enum or something to provide the same kind of check and move forward</p>



<a name="246147546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246147546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246147546">(Jul 15 2021 at 19:59)</a>:</h4>
<p>but I wonder ... shouldn't we handle this at the HIR level using <code>ImplTraitContext::Disallowed</code> somehow</p>



<a name="246147659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246147659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246147659">(Jul 15 2021 at 20:00)</a>:</h4>
<p>and have the compiler not even try to typeck invalid code</p>



<a name="246158231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246158231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246158231">(Jul 15 2021 at 21:21)</a>:</h4>
<p>to me it seems like because there are two different feature flags that trigger this behaviour/check, and the error message needs to know which of the two triggered it</p>



<a name="246158371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246158371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246158371">(Jul 15 2021 at 21:23)</a>:</h4>
<p>yeah but I wonder why don't we error before using <code>Disallowed</code>?</p>



<a name="246158473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246158473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246158473">(Jul 15 2021 at 21:24)</a>:</h4>
<p>in oli's <a href="https://github.com/rust-lang/rust/commit/4a6dc8e20328ecb627a519c6704afadcf378a72b">https://github.com/rust-lang/rust/commit/4a6dc8e20328ecb627a519c6704afadcf378a72b</a> there's the <code>impl_trait_in_bindings</code> you linked above, and <a href="https://github.com/rust-lang/rust/commit/4a6dc8e20328ecb627a519c6704afadcf378a72b#diff-1d1a5e417e4d67a3158bf9cbbd88332862840de772f1c345385d2ac34dede737R90-R109"><code>type_alias_impl_trait</code></a></p>



<a name="246158544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246158544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246158544">(Jul 15 2021 at 21:24)</a>:</h4>
<p>ah, this I have no idea :)</p>



<a name="246211330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246211330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246211330">(Jul 16 2021 at 11:28)</a>:</h4>
<p>I think we can just remove the entire function call? If we stop allowing opaque types here, then we should not call the instantiate_opaque_types_from_value function</p>



<a name="246211360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246211360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246211360">(Jul 16 2021 at 11:29)</a>:</h4>
<p>just keep the type used as input for the function as it is and use it wherever the output is used</p>



<a name="246214052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214052">(Jul 16 2021 at 12:03)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> the thing is if I pass <code>None</code> or remove things the code does compile</p>



<a name="246214058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214058">(Jul 16 2021 at 12:03)</a>:</h4>
<p>I meant, code that shouldn't compile, compiles</p>



<a name="246214076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214076">(Jul 16 2021 at 12:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246214052">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> the thing is if I pass <code>None</code> or remove things the code does compile</p>
</blockquote>
<p>None means "no feature gate required"</p>



<a name="246214082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214082">(Jul 16 2021 at 12:04)</a>:</h4>
<p>right</p>



<a name="246214133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214133">(Jul 16 2021 at 12:04)</a>:</h4>
<p>yeah I know</p>



<a name="246214139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214139">(Jul 16 2021 at 12:04)</a>:</h4>
<p>but removing it not doing anything is odd</p>



<a name="246214142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214142">(Jul 16 2021 at 12:04)</a>:</h4>
<p>it doesn't make sense to pass <code>None</code> either</p>



<a name="246214153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214153">(Jul 16 2021 at 12:04)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(min_type_alias_impl_trait)]</span><span class="w"></span>

<span class="k">type</span> <span class="nc">Foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">impl</span><span class="w"> </span><span class="nb">Send</span><span class="p">;</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">A</span><span class="p">;</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="n">VALUE</span>: <span class="nc">Foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">A</span><span class="p">;</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="246214163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214163">(Jul 16 2021 at 12:04)</a>:</h4>
<p>that code fails based on the checks there</p>



<a name="246214175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214175">(Jul 16 2021 at 12:04)</a>:</h4>
<p>I meant, what I can do is use a new enum</p>



<a name="246214178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214178">(Jul 16 2021 at 12:04)</a>:</h4>
<p>and solve the problem</p>



<a name="246214191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214191">(Jul 16 2021 at 12:04)</a>:</h4>
<p>but I don't know, it seems a bit odd to me</p>



<a name="246214222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214222">(Jul 16 2021 at 12:05)</a>:</h4>
<p>shouldn't we reject this code before getting into typeck?</p>



<a name="246214232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214232">(Jul 16 2021 at 12:05)</a>:</h4>
<p>yea, but... why is passing <code>None</code> equivalent to not doing the instantiation?</p>



<a name="246214277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214277">(Jul 16 2021 at 12:05)</a>:</h4>
<p>ahh no, I didn't try to say that</p>



<a name="246214298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214298">(Jul 16 2021 at 12:05)</a>:</h4>
<p>oh XD what's the difference?</p>



<a name="246214313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214313">(Jul 16 2021 at 12:05)</a>:</h4>
<p>well, maybe you're right, if we don't call that we get an error?</p>



<a name="246214401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214401">(Jul 16 2021 at 12:06)</a>:</h4>
<p>probably not the one we're currently getting but I guess we could adjust it somehow</p>



<a name="246214472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214472">(Jul 16 2021 at 12:07)</a>:</h4>
<p>yea, I'd expect a different error</p>



<a name="246214506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214506">(Jul 16 2021 at 12:07)</a>:</h4>
<p>right</p>



<a name="246214512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214512">(Jul 16 2021 at 12:07)</a>:</h4>
<p>yeah I was going to remove the call at some point</p>



<a name="246214582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214582">(Jul 16 2021 at 12:08)</a>:</h4>
<p>but wanted to make moves with more tiny steps</p>



<a name="246214588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214588">(Jul 16 2021 at 12:08)</a>:</h4>
<p>anyway, I see that doesn't make sense what I was aiming for :P</p>



<a name="246214899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214899">(Jul 16 2021 at 12:12)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> can you explain more or less the purpose of the visit there?</p>



<a name="246214902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246214902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246214902">(Jul 16 2021 at 12:12)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/gather_locals.rs#L55">https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/gather_locals.rs#L55</a></p>



<a name="246215107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215107">(Jul 16 2021 at 12:15)</a>:</h4>
<p>in particular, if we don't call <code>instantiate_opaque_types_from_value</code>, we don't have a <code>revealed_ty</code></p>



<a name="246215142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215142">(Jul 16 2021 at 12:15)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/gather_locals.rs#L83">https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/gather_locals.rs#L83</a></p>



<a name="246215240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215240">(Jul 16 2021 at 12:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246215107">said</a>:</p>
<blockquote>
<p>in particular, if we don't call <code>instantiate_opaque_types_from_value</code>, we don't have a <code>revealed_ty</code></p>
</blockquote>
<p>replace all uses of <code>revealed_ty</code> with <code>o_ty</code> ^^</p>



<a name="246215267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215267">(Jul 16 2021 at 12:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246211360">said</a>:</p>
<blockquote>
<p>just keep the type used as input for the function as it is and use it wherever the output is used</p>
</blockquote>
<p>I could have written this in a way that actually is understandable</p>



<a name="246215320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215320">(Jul 16 2021 at 12:17)</a>:</h4>
<p>basically the instantiate rewires the type if it is an opaque type, and just returns the original type if it is not. So now we just always use the original type, keeping the opaque type uninstantiated</p>



<a name="246215495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215495">(Jul 16 2021 at 12:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246215240">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246215107">said</a>:</p>
<blockquote>
<p>in particular, if we don't call <code>instantiate_opaque_types_from_value</code>, we don't have a <code>revealed_ty</code></p>
</blockquote>
<p>replace all uses of <code>revealed_ty</code> with <code>o_ty</code> ^^</p>
</blockquote>
<p>yeah was going to do that but wasn't sure was the right thing to do</p>



<a name="246215513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246215513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246215513">(Jul 16 2021 at 12:19)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>, gonna debug a bit to see what's going on</p>



<a name="246216648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246216648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246216648">(Jul 16 2021 at 12:32)</a>:</h4>
<p>before we were getting</p>



<a name="246216674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246216674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246216674">(Jul 16 2021 at 12:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0658]: type alias impl trait is not permitted here
 --&gt; test.rs:7:20
  |
7 | const VALUE: Foo = A;
  |                    ^
  |
  = note: see issue #63065 &lt;https://github.com/rust-lang/rust/issues/63065&gt; for more information
  = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
</code></pre></div>



<a name="246216680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246216680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246216680">(Jul 16 2021 at 12:32)</a>:</h4>
<p>and after doing this ...</p>



<a name="246216689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246216689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246216689">(Jul 16 2021 at 12:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[santiago@galago rust3 (remove_impl_trait_in_bindings)]$ rustc +rust3-stage1 test.rs
error[E0308]: mismatched types
 --&gt; test.rs:7:20
  |
3 | type Foo = impl Send;
  |            --------- the expected opaque type
...
7 | const VALUE: Foo = A;
  |                    ^ expected opaque type, found struct `A`
  |
  = note: expected opaque type `impl Send`
                  found struct `A`

error: could not find defining uses
 --&gt; test.rs:3:12
  |
3 | type Foo = impl Send;
  |            ^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
</code></pre></div>



<a name="246216934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246216934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246216934">(Jul 16 2021 at 12:35)</a>:</h4>
<p>makes sense!</p>



<a name="246217007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246217007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246217007">(Jul 16 2021 at 12:36)</a>:</h4>
<p>it's not a defining use anymore, so we error because we can't figure out <code>A</code> and <code>Foo</code>are the same</p>



<a name="246219471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246219471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246219471">(Jul 16 2021 at 13:02)</a>:</h4>
<p>yeah</p>



<a name="246219494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246219494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246219494">(Jul 16 2021 at 13:02)</a>:</h4>
<p>need to adjust tests and this is ready</p>



<a name="246228977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246228977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246228977">(Jul 16 2021 at 14:19)</a>:</h4>
<div class="codehilite"><pre><span></span><code>diff --git a/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr b/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr
index 36c49a954bd..f63b1fb23df 100644
--- a/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr
+++ b/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr
@@ -1,12 +1,8 @@
-error[E0658]: type alias impl trait is not permitted here
-  --&gt; $DIR/structural-match.rs:16:20
+error: `impl Send` cannot be used in patterns
+  --&gt; $DIR/structural-match.rs:19:9
    |
-LL | const VALUE: Foo = value();
-   |                    ^^^^^^^
-   |
-   = note: see issue #63065 &lt;https://github.com/rust-lang/rust/issues/63065&gt; for more information
-   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
+LL |         VALUE =&gt; (),
+   |         ^^^^^

 error: aborting due to previous error

-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/type-alias-impl-trait/structural-match.rs b/src/test/ui/type-alias-impl-trait/structural-match.rs
index daf914cc494..aed9334b3cc 100644
--- a/src/test/ui/type-alias-impl-trait/structural-match.rs
+++ b/src/test/ui/type-alias-impl-trait/structural-match.rs
@@ -1,9 +1,8 @@
 #![feature(const_impl_trait)]
 // revisions: min_tait full_tait
 #![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait, impl_trait_in_bindings))]
+#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
 //[full_tait]~^ WARN incomplete
-//[full_tait]~| WARN incomplete

 type Foo = impl Send;

@@ -13,12 +12,12 @@
 const fn value() -&gt; Foo {
     A
 }
-const VALUE: Foo = value(); //[min_tait]~ ERROR not permitted here
+const VALUE: Foo = value();

 fn test() {
     match todo!() {
         VALUE =&gt; (),
-        //[full_tait]~^ `impl Send` cannot be used in patterns
+        //~^ `impl Send` cannot be used in patterns
         _ =&gt; (),
     }
 }
</code></pre></div>



<a name="246229000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246229000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246229000">(Jul 16 2021 at 14:19)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="246229399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246229399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246229399">(Jul 16 2021 at 14:22)</a>:</h4>
<p>basically a reduced test case is ...</p>



<a name="246229406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246229406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246229406">(Jul 16 2021 at 14:22)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(const_impl_trait)]</span><span class="w"></span>

<span class="cp">#![feature(min_type_alias_impl_trait)]</span><span class="w"></span>

<span class="k">type</span> <span class="nc">Foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">impl</span><span class="w"> </span><span class="nb">Send</span><span class="p">;</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">A</span><span class="p">;</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="n">VALUE</span>: <span class="nc">Foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">value</span><span class="p">();</span><span class="w"></span>

<span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">value</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">     </span><span class="n">A</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="246229454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246229454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246229454">(Jul 16 2021 at 14:23)</a>:</h4>
<p>this compiles with the changes I'm introducing but shouldn't</p>



<a name="246229486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246229486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246229486">(Jul 16 2021 at 14:23)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[santiago@galago rust3 (remove_impl_trait_in_bindings)]$ rustc test.rs
error[E0658]: type alias impl trait is not permitted here
 --&gt; test.rs:9:20
  |
9 | const VALUE: Foo = value();
  |                    ^^^^^^^
  |
  = note: see issue #63065 &lt;https://github.com/rust-lang/rust/issues/63065&gt; for more information
  = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
[santiago@galago rust3 (remove_impl_trait_in_bindings)]$ rustc +rust3-stage1 test.rs
warning: type alias is never used: `Foo`
 --&gt; test.rs:5:1
  |
5 | type Foo = impl Send;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: struct is never constructed: `A`
 --&gt; test.rs:7:8
  |
7 | struct A;
  |        ^

warning: constant is never used: `VALUE`
 --&gt; test.rs:9:1
  |
9 | const VALUE: Foo = value();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `value`
  --&gt; test.rs:11:11
   |
11 |  const fn value() -&gt; Foo {
   |           ^^^^^

warning: 4 warnings emitted
</code></pre></div>



<a name="246231849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246231849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246231849">(Jul 16 2021 at 14:40)</a>:</h4>
<p>I think this should be prevented in hir lowering</p>



<a name="246231878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246231878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246231878">(Jul 16 2021 at 14:40)</a>:</h4>
<p>or... wait it's not <code>const FOO: impl Trait</code></p>



<a name="246231885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246231885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246231885">(Jul 16 2021 at 14:41)</a>:</h4>
<p>hmm</p>



<a name="246232004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246232004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246232004">(Jul 16 2021 at 14:42)</a>:</h4>
<p>let's just allow it under <code>min_type_alias_impl_trait</code></p>



<a name="246232081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246232081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246232081">(Jul 16 2021 at 14:42)</a>:</h4>
<p>and add an entry to the tracking issue so we talk about it</p>



<a name="246236088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246236088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246236088">(Jul 16 2021 at 15:08)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="246236111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246236111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246236111">(Jul 16 2021 at 15:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck/near/246232081">said</a>:</p>
<blockquote>
<p>and add an entry to the tracking issue so we talk about it</p>
</blockquote>
<p>to <code>min_type_alias_impl_trait</code> tracking issue you meant?</p>



<a name="246236152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246236152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246236152">(Jul 16 2021 at 15:09)</a>:</h4>
<p>yea</p>



<a name="246348498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/impl_trait_let_binding%20error%20detection%20in%20typeck/near/246348498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/impl_trait_let_binding.20error.20detection.20in.20typeck.html#246348498">(Jul 17 2021 at 22:57)</a>:</h4>
<p>(didn't read this topic, let me know if there are any questions for me here :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>